UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/ODf27GzAOqHaEBIZ74b5dHAR5EJvfNv/jy3LLJmNxk='
WHERE
key_id = '02f159f7bd5c3b0740ae58f559eb39498f8d05188e275239816602c2625a4398'
AND (
token = '/ODf27GzAOqHaEBIZ74b5dHAR5EJvfNv/jy3LLJmNxk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)