UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+adEuGPr/bXIUEZ7W58stwLOfr7A9nqLPO6op4GR+MI=' 
WHERE 
  key_id = 'ed8ce145177f0a5e4cf457441a483a954341b13ece1b417637aaa8a4720919d0' 
  AND (
    token = '+adEuGPr/bXIUEZ7W58stwLOfr7A9nqLPO6op4GR+MI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031