UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'O+Ls0LIL5o4AD6tNfPjsJ72ANes+KVHsvivHI2Ci808='
WHERE
key_id = 'ec328fb11c3feede81c52f8a22002dd723219c0f2415ef4bf7a885ccbf19b91d'
AND (
token = 'O+Ls0LIL5o4AD6tNfPjsJ72ANes+KVHsvivHI2Ci808='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)