UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FD+7TTziGKIsGHZYem3d2iweO0nWRoza7vuZjiTWOEE='
WHERE
key_id = 'cd906b2e7ca95c2facc85f8de22dcc44153da3b904296ed0b8dc9ccbb304a6da'
AND (
token = 'FD+7TTziGKIsGHZYem3d2iweO0nWRoza7vuZjiTWOEE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)