UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ldb4m3qwrP2PTb/P2RyhImKlshagR1wIK87cwY1xgzs='
WHERE
key_id = '00d2656a78bbfeccb9eb514043b91f4cad29e2d8edf6b7743357209d24607b61'
AND (
token = 'ldb4m3qwrP2PTb/P2RyhImKlshagR1wIK87cwY1xgzs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)