UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'spsYtv5/CVvYcgTAoOHiQn8jblxr9LAUDPaKsBLl6do='
WHERE
key_id = '9542a4322a1117a457e78c3811862ee45a9af13253a705299fe7d28baae8d2b7'
AND (
token = 'spsYtv5/CVvYcgTAoOHiQn8jblxr9LAUDPaKsBLl6do='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)