UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LpoeKOt1yjEnnFf6OU8TjC3/aOtq7GkB6dmPId/UcQ0='
WHERE
key_id = 'd2f6138345f1c2bddf59d2b79c7ea5c5a402a1e61e6f9ecc28d626e90560c6dd'
AND (
token = 'LpoeKOt1yjEnnFf6OU8TjC3/aOtq7GkB6dmPId/UcQ0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)