UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'empmGH89gBtQMd++WWwZVsGhN5CAO2AQ1yf2CNDCHWQ='
WHERE
key_id = '1905a83972f2580da19456649f622abd075dfd25033402f4b337fe0932c91e69'
AND (
token = 'empmGH89gBtQMd++WWwZVsGhN5CAO2AQ1yf2CNDCHWQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)