UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6sCprIhvc5okVEc+tQq/lDupQiGx6zcC1Gz6gnMXnyQ=' 
WHERE 
  key_id = 'a84b46182393d4de0309857bafb4ce3370210f453fcc849cf0bee926392b85f4' 
  AND (
    token = '6sCprIhvc5okVEc+tQq/lDupQiGx6zcC1Gz6gnMXnyQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039