UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wlnnLZ538bbHzCGO1CaylDbS6/lP9dm4h/NPfAff+sc=' 
WHERE 
  key_id = 'e0a02b9d846374373aa4b83fe5fa728c31f4a15f555139a5d72dbb15f2f2fc62' 
  AND (
    token = 'wlnnLZ538bbHzCGO1CaylDbS6/lP9dm4h/NPfAff+sc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047