UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9sxXVN7x7O5dWuQqOR9d5SqM6/6EYzY2XovSjePrwXg='
WHERE
key_id = 'ff79e7fd236f0847090c025fcbeb45be25c271f69747d35df30c71f90bc0797a'
AND (
token = '9sxXVN7x7O5dWuQqOR9d5SqM6/6EYzY2XovSjePrwXg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)