UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qJIAsqxrQGIS9Fc29hN1tVxNseneBBQ8Uv9Jp4H8Sn8=' 
WHERE 
  key_id = '82489d1281fa3de83e784137705e7434fd6939ea177ca670cf53c0d245ce0d92' 
  AND (
    token = 'qJIAsqxrQGIS9Fc29hN1tVxNseneBBQ8Uv9Jp4H8Sn8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045