UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8s2DHKearoQjNMwcLrh7sRlCwnJX4clfMVZUXnqZvLY='
WHERE
key_id = '22a5890b8104a40f53a12415f52f0814f67421f485a365e44cac8cc767996725'
AND (
token = '8s2DHKearoQjNMwcLrh7sRlCwnJX4clfMVZUXnqZvLY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)