UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'q7HdHCPvIVqf4/n1cqEXghPPnh+G3bKbor0JB3s5guo=' 
WHERE 
  key_id = 'c0edd96fbdec578728f5683594fbaa39c435f7806fbbfaf41e28b4b247ad85e9' 
  AND (
    token = 'q7HdHCPvIVqf4/n1cqEXghPPnh+G3bKbor0JB3s5guo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052