UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'T/m5HAA4IQU67uwHjcGltbYB2N6jGZvYvQvH9M1sG6g='
WHERE
key_id = '826c54623ba9e2df3f87659930542405b4395714c6b3f6d8f1f40b6c75da7d64'
AND (
token = 'T/m5HAA4IQU67uwHjcGltbYB2N6jGZvYvQvH9M1sG6g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)