UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+iiH1U72wTqy2ogEKuuWvJxlD6M6ApDKmuaIBX2TQpY=' 
WHERE 
  key_id = '9350489bd3d423f4445e5b493d4262795b659825fc71dfa6d17300b24391a403' 
  AND (
    token = '+iiH1U72wTqy2ogEKuuWvJxlD6M6ApDKmuaIBX2TQpY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043