UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wmbD8/A4PW0MGi8IYdsVawmjd7Vh5tJwqZgzUPFQxms=' 
WHERE 
  key_id = '82cf270148a51172de17fe1bee153ac1f4d1cce205975293662418bd14e0abdd' 
  AND (
    token = 'wmbD8/A4PW0MGi8IYdsVawmjd7Vh5tJwqZgzUPFQxms=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035