UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JPEmBKPgK54BDBP46J0zn8l6/6JrnLfSJis7ilqnJsM=' 
WHERE 
  key_id = '25fd5c0c74f67be4eac3127a58c7363d7efd4af81a9b9d1d40fba857f4803202' 
  AND (
    token = 'JPEmBKPgK54BDBP46J0zn8l6/6JrnLfSJis7ilqnJsM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037