UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'o6vh27cBrkUz38bJhhABBJPYHJUcXJr/UA6vvsDxN1E='
WHERE
key_id = '9635a8bb7baddebebd430d311ae3464338be09f6ed326bdadc05429bc1a1e165'
AND (
token = 'o6vh27cBrkUz38bJhhABBJPYHJUcXJr/UA6vvsDxN1E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)