UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gQYeGcP0vLBhfKd7j6LygpADijo6rp9Ct05eRwA7fYg='
WHERE
key_id = '5384fca962dd93c511fca0e526c06bbf6c6289d2b8af74bb6e485dbdc423bad2'
AND (
token = 'gQYeGcP0vLBhfKd7j6LygpADijo6rp9Ct05eRwA7fYg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)