UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Fot4GolHeK0BvKGp/aU1/SvcmLQQulx5LIYs7X9lBbM='
WHERE
key_id = 'cce7e394f55a71ea1e005b84fe421bf5b896971af0c813f8887d082c8d3d1cfd'
AND (
token = 'Fot4GolHeK0BvKGp/aU1/SvcmLQQulx5LIYs7X9lBbM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)