UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jaEwkNwqJEdl+C+sWn4JKchWS7X3IsUNfdMsGEQtsiU=' 
WHERE 
  key_id = '703ccc2377e5ef0c0e917b167672b9d2009136193db4df388d9e03dc72ac97cc' 
  AND (
    token = 'jaEwkNwqJEdl+C+sWn4JKchWS7X3IsUNfdMsGEQtsiU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034