UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CfplGB9r6ddvFUorFjNEYaPz5JipBx0tQSPZwUV1uX8='
WHERE
key_id = '53ef4ff39be53a48bf4b6cc304c5327ac8dfaad1e956535f140f6612fd4e7995'
AND (
token = 'CfplGB9r6ddvFUorFjNEYaPz5JipBx0tQSPZwUV1uX8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)