UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JgSbxMr0w4eIu3aNXoZrp+4kXS8KjmKPIQx7qfzXG3w='
WHERE
key_id = '48a8ab44d0d4cbb0c60df6dd29aec12109cf947c5b4d6168eeefa1aa9999b6eb'
AND (
token = 'JgSbxMr0w4eIu3aNXoZrp+4kXS8KjmKPIQx7qfzXG3w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)