UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PvRbYgHKgWfIC1H92EdwIKJDWSNaHWNe8MASIDgmc+I='
WHERE
key_id = '033be7acfece67c775c7f1ae3d9b3ad419415c4472f0592c4d7319201825e4f5'
AND (
token = 'PvRbYgHKgWfIC1H92EdwIKJDWSNaHWNe8MASIDgmc+I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)