UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'knJH+0jRLmQs/0XSNUTXHKOxXXb+BskWvXUhRSrbxBw='
WHERE
key_id = 'e4279d52afb4d20647fb105c2bc23e7c6f75a4f4bb48b9078ca17d53fe048a65'
AND (
token = 'knJH+0jRLmQs/0XSNUTXHKOxXXb+BskWvXUhRSrbxBw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)