UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Oeluht8zQ5AUrvF7mFkiYBkKYz6K2Mqj2vOKPYhh1y0='
WHERE
key_id = '3d7af83ee94fcf4dace9272770cd2875e0858d18021ff2f3f070456911a0d861'
AND (
token = 'Oeluht8zQ5AUrvF7mFkiYBkKYz6K2Mqj2vOKPYhh1y0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)