UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GkeeMsw5JsCIq4FzC/BcFfvZgR4OmlP8XA5Z1B3Zs74='
WHERE
key_id = '64f3c93b457c6f24ee5e67c51f5af16af255ade2d6fe1a3086811b25f71b0996'
AND (
token = 'GkeeMsw5JsCIq4FzC/BcFfvZgR4OmlP8XA5Z1B3Zs74='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)