UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zgu1iECeCQU9HntyQ61A2JrS/OJw1w2jGEw2xt/mbJM=' 
WHERE 
  key_id = '8eff038cdfb7fc72177d430d42ecf7174bab83f283dc83a75e9a29ed2503c587' 
  AND (
    token = 'zgu1iECeCQU9HntyQ61A2JrS/OJw1w2jGEw2xt/mbJM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020