UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bJV56ZhbfTN8ELMVkSzowhAGNCTIpF9ihFKjR5U6Pp4='
WHERE
key_id = '625c2752abedeb676535af68498d1701c0507c02e53e0aa53fe6c8b9c6880cc5'
AND (
token = 'bJV56ZhbfTN8ELMVkSzowhAGNCTIpF9ihFKjR5U6Pp4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)