UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8U+13qNLIVdrerQRbSYTWnS8ZkWfE4jtHbex16ZZYCk='
WHERE
key_id = 'ced3dc39b5b051ac37606d4defd61cba16e2d6b8425a86bcb202acf3c97b45aa'
AND (
token = '8U+13qNLIVdrerQRbSYTWnS8ZkWfE4jtHbex16ZZYCk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)