UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zDqAksLRg4yd0gejofr7QXeyF6KYKC9WAbCHpV3DJIM='
WHERE
key_id = '2815840bb05d6a0cedc5977c4476c291507faaa7e7fbe4f061f40d7700e7cf9f'
AND (
token = 'zDqAksLRg4yd0gejofr7QXeyF6KYKC9WAbCHpV3DJIM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)