UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3DAWF1OR7+5mVzP0qe1RQclz1N7J7eYF6nCKSwxL4/g='
WHERE
key_id = 'eacaaa35a40e91fad47f686d8bc620fd5704e76ddda3678dfdf4dc23a2d03067'
AND (
token = '3DAWF1OR7+5mVzP0qe1RQclz1N7J7eYF6nCKSwxL4/g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)