UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '80NvZV+2kVVPxxvFlflvjmK9HWQxbYFv2rUUyxK4a0M='
WHERE
key_id = 'beee3faafc98a095ccd2e80a8752e23c3f564d2eb7cc1944b950b17de0ecb0b2'
AND (
token = '80NvZV+2kVVPxxvFlflvjmK9HWQxbYFv2rUUyxK4a0M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)