UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rHMB+A5JChNZwZQhyFACjPHqOzx7i+SMgr2ppF7KMU4=' 
WHERE 
  key_id = 'bb9064601cee0402a16213709b7dc11873f7605f1b63e8db48457f3d0af00c0e' 
  AND (
    token = 'rHMB+A5JChNZwZQhyFACjPHqOzx7i+SMgr2ppF7KMU4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00056