UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+FwsOt6GYWsI3dtkq5TsMheg7n/C06wRekIkwLH1r+I='
WHERE
key_id = '57a640ed10f685e6ee2fb5d5ad186a0cb4ea75f44fb09db7793a4f5cec074cc6'
AND (
token = '+FwsOt6GYWsI3dtkq5TsMheg7n/C06wRekIkwLH1r+I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)